﻿<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="UserList.aspx.cs" Inherits="AnOtherBlog.AJAX.Admin.Users.UserList" Title="" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<%--
	<div class="framecontentMsg">
		<asp:Label id="lblMsg" runat="server" EnableViewState="False" CssClass="lblMsg"></asp:Label>
	</div>
--%>
	<div id="mainContentRegion">
		<div id="admin_centercontent">
			<div class="sectionHeader">
				<asp:Label ID="lblUserAdministration" runat="server" Text="<%$ Resources:AdminUsers,lblUserAdministration %>" />
			</div>
			<br />

			<asp:Panel ID="pnlUserSearch" runat="server" GroupingText="<%$ Resources:AdminUsers,pnlUserSearch %>" >
				<asp:Label ID="lblSearchBy" runat="server" Text="Buscar por:" CssClass="label" /><br />
				<asp:DropDownList ID="ddlSearchBy" runat="server" CssClass="dropdownlist" />&nbsp;
				<asp:TextBox ID="txtSearchBy" runat="server" CssClass="textbox" />&nbsp;
				<asp:Button ID="btnSearch" runat="server" Text="Buscar" CssClass="button" OnClick="btnSearch_Click" />
			</asp:Panel>
			<br />

			<asp:Panel ID="pnlUserList" runat="server" GroupingText="<%$ Resources:AdminUsers,pnlUserList %>" >
				<asp:Label ID="lblTotalUsers" runat="server" Text="<%$ Resources:AdminUsers,lblTotalUsers %>" CssClass="label"/>&nbsp;
				<asp:Label ID="lblNumberOfTotalUsers" runat="server" CssClass="label"/>
				&nbsp;&nbsp;
				<asp:HyperLink ID="hlAddUser" runat="server" Text="<%$ Resources:AdminUsers,hlAddUser %>" 
					ImageUrl="~/Admin/Images/Icons/addNew.gif" 
					NavigateUrl="~/Admin/Users/UserEdit.aspx" />
				<br /><br />

				<asp:GridView ID="gvUserList" runat="server" 
					AutoGenerateColumns="False" 
					AllowPaging="True" 
					CssClass="adminTable" 
					OnPageIndexChanging="gvUserList_PageIndexChanging" 
					PageSize="10" 
					SkinID="adminGridView" 
					>
					<Columns>
						<asp:TemplateField HeaderText="<%$ Resources:AdminUsers,hdrActive %>" >
							<HeaderStyle HorizontalAlign="Center" />
							<ItemStyle HorizontalAlign="Center" />
							<ItemTemplate>
								<asp:CheckBox runat="server" ID="chkActive" OnCheckedChanged="EnabledChanged" 
									AutoPostBack="true" Checked='<%#DataBinder.Eval(Container.DataItem, "IsApproved")%>' 
									Value='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' />
							</ItemTemplate>
						</asp:TemplateField>

						<asp:TemplateField HeaderText="<%$ Resources:AdminUsers,hdrUserName %>" >
							<ItemTemplate>
								<asp:HyperLink ID="hlUserEdit" runat="server" 
									NavigateUrl='<%# FormatEditUrl(DataBinder.Eval(Container.DataItem, "UserName").ToString()) %>' 
									Text='<%# Eval("UserName") %>' />
							</ItemTemplate>
						</asp:TemplateField>

						<asp:TemplateField HeaderText="<%$ Resources:AdminUsers,hdrEmailAddress %>" >
							<ItemTemplate>
								<asp:HyperLink ID="EmailLink" runat="server" 
									NavigateUrl='<%# Eval("Email", "mailto:{0}") %>' 
									Text='<%# Eval("Email") %>' />
							</ItemTemplate>
						</asp:TemplateField>

						<asp:BoundField HeaderText="<%$ Resources:AdminUsers,hdrCreatedOn %>" 
							DataField="CreationDate" ReadOnly="True" SortExpression="CreationDate" />
						<asp:BoundField HeaderText="<%$ Resources:AdminUsers,hdrLastLogin %>" 
							DataField="LastLoginDate" SortExpression="LastLoginDate" />

						<asp:TemplateField HeaderText="<%$ Resources:AdminUsers,hdrDelete %>" >
							<ItemStyle HorizontalAlign="Center" />
							<ItemTemplate>
								<asp:LinkButton runat="server" ID="lbDelete" CommandName="mydelete" Text="<%$ Resources:AdminUsers,lbDelete %>"
									CommandArgument='<%#DataBinder.Eval(Container.DataItem, "UserName")%>' 
									OnCommand="lbDelete_Click" />
							</ItemTemplate>
						</asp:TemplateField>

					</Columns>
				</asp:GridView>
				<br />

				<asp:HyperLink ID="hlShowAll" runat="server" Text="<%$ Resources:AdminUsers,hlShowAll %>" 
					CssClass="showAll" 
					NavigateUrl="~/Admin/Users/UserList.aspx"
					Visible="true" />
			</asp:Panel>
		</div>
	</div>

</asp:Content>
